home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / lib / mntlib44.zoo / mntlib / abort.c < prev    next >
C/C++ Source or Header  |  1994-03-01  |  714b  |  38 lines

  1. /* by ERS, modified by entropy */
  2.  
  3. #include <signal.h>
  4. #include <stdlib.h>
  5. #include <unistd.h>
  6. #include <mintbind.h>
  7. #include "lib.h"
  8.  
  9. #ifndef SIGABRT
  10. #define SIGABRT SIGIOT
  11. #endif
  12.  
  13. extern int __mint;
  14.  
  15. __EXITING
  16. abort()
  17. {
  18. #ifdef __MINT__
  19.     if (__mint)
  20.         {
  21.         (void) Pkill(Pgetpid(), SIGABRT);
  22.         /* process still alive, maybe SIGABRT was blocked */
  23.         (void) Psigsetmask(Psigblock(0) & ~(sigmask(SIGABRT)));
  24.         /* process still alive, maybe SIGABRT was ignored */
  25.         /* is this correct if user SIGABRT handler returns? */
  26.         (void) Psignal(SIGABRT, (long) SIG_DFL);
  27.         (void) Pkill(Pgetpid(), SIGABRT);
  28.         }
  29.     else
  30.         raise(SIGABRT);
  31.     _fclose_all_files();
  32.     _exit(127);
  33. #else
  34.     raise(SIGABRT);
  35.     exit(127);
  36. #endif
  37. }
  38.